package com.example.kuaizu.job;

import com.example.kuaizu.service.InProjectBaseService;
import com.example.kuaizu.utils.TimeUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @author: wangmx15
 * @date: 2025/9/6
 **/
@Component
@RequiredArgsConstructor
@Log4j2
public class ProjectRemindJob extends BaseJob{
    private final InProjectBaseService projectBaseService;
    @Override
    void doExecute() {
        projectBaseService.getEveryProjectJoinCont();
    }

    /**
     * 项目投递人数通知给项目创建者的消息定时任务
     */
    @Scheduled(cron = "0 0 */6 * * ?")
    //@Scheduled(cron = "*/5 * * * * ?")
    public void sendProjectMessageDlxQueues() {
        //判断当前时间如果是22:00-07:00之间在不执行任务
        if (TimeUtil.isBetweenNightAndMorning(22,7)) {
            log.info("当前时间是22:00-07:00，不执行任务");
            return;
        }
       this.execute();
    }


}
